<template>
	<view>
		<view class="new-list">
			<view class="title">
				新品推荐
			</view>
			<view class="list">
				<view class="item" v-for="item in dataList" :key="item.id" @tap="toGoodsInfo(item.id)">
					<image :src="item.pic" mode=""></image>
					<view class="text-holder">
						<view>{{item.name}}</view>
						<view>价格：{{item.price}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:["dataList"],
		methods: {
			toGoodsInfo(id){
				uni.navigateTo({
					url: `/pages/goodsInfo/goodsInfo?goodsId=${id}`,
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.new-list {
		box-sizing: border-box;
		padding: 0 30rpx;
		width: 100%;

		.title {
			padding: 30rpx 0;
			font-size: 32rpx;
			color: 3e3e3e;
			font-weight: 600;
		}

		.list {
			display: flex;
			align-items: center;
			height: 260rpx;
			width: 100%;
			overflow:scroll;
			.item{
				margin-left: 20rpx;
				box-sizing: border-box;
				padding: 50rpx 20rpx 50rpx 50rpx;
				display: flex;
				width: 590rpx;
				height: 100%;
				flex-shrink: 0;
				background-color: #fff;
				border-radius: 20rpx;
				image{
					width: 194rpx;
					height: 168rpx;
				}
				.text-holder{
					display: flex;
					flex-wrap: wrap;
					align-content: space-between;
					flex: 1;
					margin-left: 20rpx;
					font-size: 26rpx;
					color: #3e3e3e;
				}
			}
		}
	}
</style>
